package org.zxp.javacheck.InnerClass.staticinnerclass;

/**
 * @program: effectiveJava
 * @description:
 * @author: X-Pacific zhang
 * @create: 2019-08-21 14:03
 **/
public class StaticInnerClass {
    public void doing(){
        Inner.show();
        new Inner().show2();
    }

    public void doing2(){
    }

    //如果不是静态内部类，不能有static方法
    public static class Inner{
        static{
            System.out.println("我加载了");
        }

        public static void show(){
            System.out.println("我是静态内部类，路径是："+Inner.class.getName());
        }

        public void show2(){
            System.out.println("我是静态内部类，路径是："+this.getClass().getName()+" hashcode："+this.hashCode());
        }
    }
}
